<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Module erlrrd</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>

<h1>Module erlrrd</h1>
<ul class="index"><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>

<p><b>Behaviours:</b> <a href="gen_server.html"><tt>gen_server</tt></a>.</p>

<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#c-1">c/1</a></td><td>Equivalent to <a href="#combine-1"><tt>combine(Args)</tt></a>.
</td></tr>
<tr><td valign="top"><a href="#cd-1">cd/1</a></td><td>  ask the rrdtool unix process to change directories.</td></tr>
<tr><td valign="top"><a href="#combine-1">combine/1</a></td><td>"joins" and quotes the given arg list.</td></tr>
<tr><td valign="top"><a href="#create-1">create/1</a></td><td>Set up a new Round Robin Database (RRD).</td></tr>
<tr><td valign="top"><a href="#dump-1">dump/1</a></td><td>   Dump the contents of an RRD in plain ASCII.</td></tr>
<tr><td valign="top"><a href="#fetch-1">fetch/1</a></td><td>  Get data for a certain time period from a RRD.</td></tr>
<tr><td valign="top"><a href="#first-1">first/1</a></td><td>Return the date of the first data sample in an RRA within an
        RRD.</td></tr>
<tr><td valign="top"><a href="#graph-1">graph/1</a></td><td>  Create a graph from data stored in one or several RRDs.</td></tr>
<tr><td valign="top"><a href="#info-1">info/1</a></td><td>Get information about an RRD.</td></tr>
<tr><td valign="top"><a href="#last-1">last/1</a></td><td>   Return the date of the last data sample in an RRD.</td></tr>
<tr><td valign="top"><a href="#lastupdate-1">lastupdate/1</a></td><td>   Return the most recent update to an RRD.</td></tr>
<tr><td valign="top"><a href="#ls-0">ls/0</a></td><td> lists all *.rrd files in rrdtool unix process'
        current working directory.</td></tr>
<tr><td valign="top"><a href="#mkdir-1">mkdir/1</a></td><td>  ask the rrdtool unix process to create a directory.</td></tr>
<tr><td valign="top"><a href="#pwd-0">pwd/0</a></td><td> return the rrdtool unix process'
        current working directory.</td></tr>
<tr><td valign="top"><a href="#resize-1">resize/1</a></td><td>   Change the size of individual RRAs.</td></tr>
<tr><td valign="top"><a href="#restore-1">restore/1</a></td><td>Restore an RRD in XML format to a binary RRD.</td></tr>
<tr><td valign="top"><a href="#start_link-2">start_link/2</a></td><td>calls gen_server:start_link
    RRDToolCmd is the command passed to open_port()
    usually "rrdtool -".</td></tr>
<tr><td valign="top"><a href="#tune-1">tune/1</a></td><td>Alter setup of an RRD.</td></tr>
<tr><td valign="top"><a href="#update-1">update/1</a></td><td>Store new data values into an RRD.</td></tr>
<tr><td valign="top"><a href="#updatev-1">updatev/1</a></td><td>Operationally equivalent to update except for output.</td></tr>
<tr><td valign="top"><a href="#xport-1">xport/1</a></td><td>  Export data retrieved from one or several RRDs.</td></tr>
</table>

<h2><a name="functions">Function Details</a></h2>

<h3 class="function"><a name="c-1">c/1</a></h3>
<div class="spec">
<p><tt>c(Args::List) -&gt; List</tt>
<ul class="definitions"><li><tt>List = [term()]</tt></li>
</ul></p>
</div><p>Equivalent to <a href="#combine-1"><tt>combine(Args)</tt></a>.</p>


<h3 class="function"><a name="cd-1">cd/1</a></h3>
<div class="spec">
<p><tt>cd(Arg::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; ok | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p><p>  ask the rrdtool unix process to change directories</p>
 
     <p>erlrrd:cd("/usr/share/rrd/data").</p>
 
     erlrrd:cd(erlrrd:combine(["/Users/foo/Library/Application Support/myapp/rrd"]).</p>

<h3 class="function"><a name="combine-1">combine/1</a></h3>
<div class="spec">
<p><tt>combine(Args::List) -&gt; List</tt>
<ul class="definitions"><li><tt>List = [term()]</tt></li>
</ul></p>
</div><p><p>"joins" and quotes the given arg list.    
takes a list of arguments, and returns a deeplist with    
each argument surrounded by double quotes    
then separated by spaces</p>
 
    <p>combine(["these", "are", "my args"]). -&gt;</p>
 
    <p>[["\"","these","\""]," ",["\"","are","\""]," ",["\"","my args","\""]]</p>
 
    <p>it is intended as a convinence function to the    
rrdtool commands which all take a single iodata() argument    
which represents the string to be passed as the arguments    
to the corresponding rrdtool command.</p>
 
    erlrrd:xport(erlrrd:c(["DEF:foo=/path with/space/foo.rrd:foo:AVERAGE", "XPORT:foo"])).</p>

<h3 class="function"><a name="create-1">create/1</a></h3>
<div class="spec">
<p><tt>create(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>Set up a new Round Robin Database (RRD). Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html" target="_top">rrdcreate</a>.</p>

<h3 class="function"><a name="dump-1">dump/1</a></h3>
<div class="spec">
<p><tt>dump(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>   Dump the contents of an RRD in plain ASCII. In connection with
          restore you can use this to move an RRD from one computer
          architecture to another.  Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrddump.en.html" target="_top">rrddump</a>.</p>

<h3 class="function"><a name="fetch-1">fetch/1</a></h3>
<div class="spec">
<p><tt>fetch(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>  Get data for a certain time period from a RRD. The graph func-
          tion uses fetch to retrieve its data from an RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdfetch.en.html" target="_top">rrdfetch</a>.</p>

<h3 class="function"><a name="first-1">first/1</a></h3>
<div class="spec">
<p><tt>first(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = integer()</tt></li>
</ul></p>
</div><p>Return the date of the first data sample in an RRA within an
        RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdfirst.en.html" target="_top">rrdfirst</a></p>

<h3 class="function"><a name="graph-1">graph/1</a></h3>
<div class="spec">
<p><tt>graph(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>  Create a graph from data stored in one or several RRDs. Apart
          from generating graphs, data can also be extracted to stdout.
          Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html" target="_top">rrdgraph</a>.</p>

<h3 class="function"><a name="info-1">info/1</a></h3>
<div class="spec">
<p><tt>info(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>Get information about an RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdinfo.en.html" target="_top">rrdinfo</a>.</p>

<h3 class="function"><a name="last-1">last/1</a></h3>
<div class="spec">
<p><tt>last(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = integer()</tt></li>
</ul></p>
</div><p>   Return the date of the last data sample in an RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdlast.en.html" target="_top">rrdlast</a></p>

<h3 class="function"><a name="lastupdate-1">lastupdate/1</a></h3>
<div class="spec">
<p><tt>lastupdate(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>   Return the most recent update to an RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdlastupdate.en.html" target="_top">rrdlastupdate</a></p>

<h3 class="function"><a name="ls-0">ls/0</a></h3>
<div class="spec">
<p><tt>ls() -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p> lists all *.rrd files in rrdtool unix process'
        current working directory</p>

<h3 class="function"><a name="mkdir-1">mkdir/1</a></h3>
<div class="spec">
<p><tt>mkdir(Arg::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>  ask the rrdtool unix process to create a directory</p>

<h3 class="function"><a name="pwd-0">pwd/0</a></h3>
<div class="spec">
<p><tt>pwd() -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = string()</tt></li>
</ul></p>
</div><p> return the rrdtool unix process'
        current working directory.</p>

<h3 class="function"><a name="resize-1">resize/1</a></h3>
<div class="spec">
<p><tt>resize(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>   Change the size of individual RRAs. This is dangerous! Check
          rrdresize.</p>

<h3 class="function"><a name="restore-1">restore/1</a></h3>
<div class="spec">
<p><tt>restore(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>Restore an RRD in XML format to a binary RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdrestore.en.html" target="_top">rrdrestore</a></p>

<h3 class="function"><a name="start_link-2">start_link/2</a></h3>
<div class="spec">
<p><tt>start_link(Id::atom, RRDToolCmd) -&gt; Result</tt>
<ul class="definitions"><li><tt>RRDToolCmd = [term()]</tt></li>
<li><tt>Result = {ok, Pid} | ignore | {error, Error}</tt></li>
<li><tt>Pid = pid()</tt></li>
<li><tt>Error = {already_started, Pid} | shutdown | term()</tt></li>
</ul></p>
</div><p>calls gen_server:start_link
    RRDToolCmd is the command passed to open_port()
    usually "rrdtool -"</p>

<h3 class="function"><a name="tune-1">tune/1</a></h3>
<div class="spec">
<p><tt>tune(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>Alter setup of an RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdtune.en.html" target="_top">rrdtune</a>.</p>

<h3 class="function"><a name="update-1">update/1</a></h3>
<div class="spec">
<p><tt>update(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>Store new data values into an RRD. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdupdate.en.html" target="_top">rrdupdate</a>.</p>

<h3 class="function"><a name="updatev-1">updatev/1</a></h3>
<div class="spec">
<p><tt>updatev(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p>Operationally equivalent to update except for output. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdupdate.en.html" target="_top">rrdupdate</a>.</p>

<h3 class="function"><a name="xport-1">xport/1</a></h3>
<div class="spec">
<p><tt>xport(Args::<a href="erlang.html#type-iodata">erlang:iodata()</a>) -&gt; {ok, Response} | {error, Reason}</tt>
<ul class="definitions"><li><tt>Reason = <a href="#type-iolist">iolist()</a></tt></li>
<li><tt>Response = <a href="#type-iolist">iolist()</a></tt></li>
</ul></p>
</div><p><p>  Export data retrieved from one or several RRDs. Check
  <a href="http://oss.oetiker.ch/rrdtool/doc/rrdxport.en.html" target="_top">rrdxport</a></p>
 
   <p>erlrrd:xport("'DEF:foo=/path with/space/foo.rrd:foo:AVERAGE' XPORT:foo").</p>
 
   erlrrd:xport(erlrrd:c(["DEF:foo=/path with/space/foo.rrd:foo:AVERAGE", "XPORT:foo"])).</p>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Aug 31 2009, 16:51:25.</i></p>
</body>
</html>
